<template>
	<app-dialog ref="dialog" width="90%" :title="title" @confirm="save">
		<view style="padding: 20rpx">
			<u-form :model="form" :rules="rules" :labelStyle="{ color: '#666' }" labelWidth="auto" labelPosition="top" ref="uFormRef">
				<u-form-item label="相册名称" prop="corp" borderBottom
					@click="show=true; hideKeyboard()" >
					<u-input placeholder="请输入相册名称" disabledColor="#ffffff"  v-model="form.corp"></u-input>
				</u-form-item>
			</u-form>
			    <u-picker :show="show" ref="uPicker" :columns="columns" @confirm="confirm" @change="changeHandler"></u-picker>

		</view>
	</app-dialog>
</template>

<script>
export default {
	components: {},

	data() {
		return {
			rules:{},
			title: '上传',
			itemList: null,
			fileList: [],
			detail: null,
			areaId: '',
		
			form: {corp:""},
			data: null,
			formData: null,
			formFile: null,
			index:"",
			show: false,
			                columns: [
			                    ['中国', '美国'],
			                    ['深圳', '厦门', '上海', '拉萨']
							],
			                columnData: [
			                    ['深圳', '厦门', '上海', '拉萨'],
			                    ['得州', '华盛顿', '纽约', '阿拉斯加']
			                ]
		};
	},

	methods: {
		/**
		 * 打开弹框
		 */
		/**
	
		 */
		async open() {
			this.reset();
		
			// 打开弹框
			await this.$refs.dialog.open();
		},

		reset() {
		
		},
		 changeHandler(e) {
		                const {
		                    columnIndex,
		                    value,
		                    values, // values为当前变化列的数组内容
		                    index,
							// 微信小程序无法将picker实例传出来，只能通过ref操作
		                    picker = this.$refs.uPicker
		                } = e
		                // 当第一列值发生变化时，变化第二列(后一列)对应的选项
		                if (columnIndex === 0) {
		                    // picker为选择器this实例，变化第二列对应的选项
		                    picker.setColumnValues(1, this.columnData[index])
		                }
		            },
					// 回调参数为包含columnIndex、value、values
					confirm(e) {
		                console.log('confirm', e)
		                this.show = false
					},

		/**
		 * 保存
		 */
		async save() {
			try {
				

				///	this.$refs.dialog.close();
					//	this.hideLoading();
				
			} catch (e) {
				this.errorLoading(e);
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.auto {
	height: 980rpx;
}
</style>
